home *** CD-ROM | disk | FTP | other *** search
- /********************************************
- ; File: ProDos.h
- ;
- ;
- ; Copyright Apple Computer, Inc. 1986, 1987, 1988
- ; All Rights Reserved
- ;
- ********************************************/
-
- #ifndef __types__
- #include <types.h>
- #endif
-
- #ifndef __prodos__
- #define __prodos__
-
- #ifdef __GSOS__
-
- #undef GetSysPrefs
- #undef BeginSession
- #undef EndSession
- #undef SessionStatus
- #undef ResetCache
- #undef ChangePath
- #undef ClearBackupBit
- #undef Close
- #undef Create
- #undef DControl
- #undef Destroy
- #undef DInfo
- #undef DRead
- #undef DStatus
- #undef DWrite
- #undef EraseDisk
- #undef ExpandPath
- #undef Flush
- #undef Format
- #undef GetBootVol
- #undef GetDevNumber
- #undef GetDirEntry
- #undef GetEOF
- #undef GetFileInfo
- #undef GetFSTInfo
- #undef GetLevel
- #undef GetMark
- #undef GetName
- #undef GetPrefix
- #undef GetVersion
- #undef Newline
- #undef Null
- #undef Open
- #undef Quit
- #undef Read
- #undef SetEOF
- #undef SetFileInfo
- #undef SetLevel
- #undef SetMark
- #undef SetPrefix
- #undef UnbindInt
- #undef Volume
- #undef Write
- #undef BindInt
- #undef ChangePath
- #undef ClearBackupBit
- #undef Close
- #undef Create
- #undef DControl
- #undef Destroy
- #undef DInfo
- #undef DRead
- #undef DStatus
- #undef DWrite
- #undef EraseDisk
- #undef ExpandPath
- #undef Flush
- #undef Format
- #undef GetBootVol
- #undef GetDevNumber
- #undef GetDirEntry
- #undef GetEOF
- #undef GetFileInfo
- #undef GetFSTInfo
- #undef GetLevel
- #undef GetMark
- #undef GetName
- #undef GetPrefix
- #undef GetVersion
- #undef Newline
- #undef Null
- #undef Open
- #undef Quit
- #undef Read
- #undef SetEOF
- #undef SetFileInfo
- #undef SetLevel
- #undef SetMark
- #undef SetPrefix
- #undef UnbindInt
- #undef Volume
- #undef Write
-
- #undef ChangePathRec
- #undef CreateRec
- #undef DAccessRec
- #undef DevNumRec
- #undef DInfoRec
- #undef DIORec
- #undef DirEntryRec
- #undef ExpandPathRec
- #undef FileInfoRec
- #undef FormatRec
- #undef FSTInfoRec
- #undef InterruptRec
- #undef IORec
- #undef LevelRec
- #undef NameRec
- #undef NewlineRec
- #undef OpenRec
- #undef PositionRec
- #undef PrefixRec
- #undef QuitRec
- #undef RefNumRec
- #undef SetPositionRec
- #undef SysPrefRec
- #undef VersionRec
- #undef VolumeRec
- #undef DInfoRec
- #undef FSTInfoRec
- #undef OpenRec
- #undef VersionRec
-
- #endif
-
-
- #define invalidCallNum 0x01 /* error - invalid call number */
- #define unclaimedIntErr 0x01 /* error - fatal error - unclaimed interrupt */
- #define badPBlockPtr 0x05 /* error - call pointer out of bounds */
- #define pdosActiveErr 0x06 /* error - ProDOS is active */
- #define pdosBusyErr 0x07 /* error - ProDos is busy */
- #define vcbUnusable 0x0A /* error - fatal error - VCB unusable */
- #define fcbUnusable 0x0B /* error - fatal error - FCB unusable */
- #define badBlockZero 0x0C /* error - fatal error - block zero allocated illegally */
- #define shdwInterruptErr 0x0D /* error - fatal error - interrupt occured while I/O shadowing off */
- #ifndef devNotFound /* error - device not found */
- #define devNotFound 0x10
- #endif
- #define badDevRefNum 0x11 /* error - invalid device reference number */
- #define osVersionErr 0x11 /* error - Wrong OS version */
- #define badReqCode 0x20 /* error - invalid request code */
- #define intTableFull 0x25 /* error - interrupt table full */
- #define invalidOperation 0x26 /* error - invalid operation */
- #define ioError 0x27 /* error - I/O error */
- #define noDevConnect 0x28 /* error - no device connected */
- #define writeProtectErr 0x2B /* error - write protect error */
- #define diskSwitchErr 0x2E /* error - disk switched error */
- #define badPathName 0x40 /* error - invalid pathname syntax */
- #define fcbFullErr 0x42 /* error - FCB full error */
- #define badFileRefNum 0x43 /* error - invalid file reference number */
- #ifndef pathNotFound /* error - path not found */
- #define pathNotFound 0x44
- #endif
- #define volumeNotFound 0x45 /* error - volume not found */
- #ifndef fileNotFound /* error - file not found */
- #define fileNotFound 0x46
- #endif
- #define dupFileName 0x47 /* error - duplicate file name */
- #define volumeFullErr 0x48 /* error - volume full error */
- #define dirFullErr 0x49 /* error - directory full error */
- #define versionErr 0x4A /* error - version error (incompatible file format) */
- #ifndef badStoreType /* error - unsupported (or incorrect) storage type */
- #define badStoreType 0x4B
- #endif
- #ifndef eofEncountered /* error - end-of-file encountered */
- #define eofEncountered 0x4C
- #endif
- #define positionRangeErr 0x4D /* error - position out of range */
- #define accessErr 0x4E /* error - access not allowed */
- #define fileOpenErr 0x50 /* error - file is open */
- #define dirDamaged 0x51 /* error - directory structure is damaged */
- #define badVolType 0x52 /* error - unsupported volume type */
- #ifndef paramRangeErr /* error - parameter out of range */
- #define paramRangeErr 0x53
- #endif
- #define memoryFullErr 0x54 /* error - out of memory */
- #define vcbFullErr 0x55 /* error - VCB full error */
- #define dupVolumeErr 0x57 /* error - duplicate volume error */
- #define notBlkDevErr 0x58 /* error - not a blocked device */
- #ifndef invalidLevel /* error - invalid level */
- #define invalidLevel 0x59
- #endif
- #define blkNumRangeErr 0x5A /* error - block number out of range */
- #define notSameVolErr 0x5B /* error - different volumes found on ChangePath call */
- #define notExecSysFile 0x5C /* error - not an executable system file */
- #define osUnavailable 0x5D /* error - Operating system unavailable*/
- #define deallocateRamErr 0x5E /* error - Cannot deallocate /RAM */
- #ifndef stackOverflow /* error - Return stack overflow */
- #define stackOverflow 0x5F
- #endif
- #define dataUnavailable 0x60 /* error - Data unavailable */
-
- #define endofDirectory 0x0061 /*GetDirEntry - */
-
- /* ProDOS Interface */
-
- #define P_READ_ENABLE 1
- #define P_WRITE_ENABLE 2
- #define P_DESTROY_ENABLE (1<<7)
- #define P_RENAME_ENABLE (1<<6)
-
- /* for ReadBlock, WriteBlock */
-
- typedef struct BlockRec {
- Word blockDevNum; /* BlockRec - */
- Ptr blockDataBuffer; /* BlockRec - */
- Longint blockNum; /* BlockRec - */
- } BlockRec, *BlockRecPtr, **BlockRecHndl;
-
- /* for GetDevNum */
-
- typedef struct DevNumRec {
- Ptr devName; /* DevNumRec - */
- Word devNum; /* DevNumRec - */
- } DevNumRec, *DevNumRecPtr, **DevNumRecHndl;
-
- /* for SetEOF, GetEOF */
-
- typedef struct EOFRec {
- Word eofRefNum; /* EOFRec - */
- Longint eofPosition; /* EOFRec - */
- } EOFRec, *EOFRecPtr, **EOFRecHndl;
-
- /* for Read, Write, Close, Flush */
-
- typedef struct FileIORec {
- Word fileRefNum; /* FileIORec - */
- Ptr dataBuffer; /* FileIORec - */
- Longint requestCount; /* FileIORec - */
- Longint transferCount; /* FileIORec - */
- } FileIORec, *FileIORecPtr, **FileIORecHndl;
-
- /* for Create, SetFileInfo, GetFileInfo */
-
- typedef struct FileRec {
- Ptr pathname; /* FileRec - */
- Word fAccess; /* FileRec - */
- Word fileType; /* FileRec - */
- Longint auxType; /* FileRec - */
- Word storageType; /* FileRec - */
- Word createDate; /* FileRec - */
- Word createTime; /* FileRec - */
- Word modDate; /* FileRec - */
- Word modTime; /* FileRec - */
- Long blocksUsed; /* FileRec - */
- } FileRec, *FileRecPtr, **FileRecHndl;
-
- /* for AllocInterrupt, DeallocInterrupt */
-
- typedef struct InterruptRec {
- Word intNum; /* InterruptRec - */
- Ptr intCode; /* InterruptRec - */
- } InterruptRec, *InterruptRecPtr, **InterruptRecHndl;
-
- /* for SetLevel, GetLevel */
-
- typedef struct LevelRec {
- Word level; /* LevelRec - */
- } LevelRec, *LevelRecPtr, **LevelRecHndl;
-
- /* for SetMark, GetMark */
-
- typedef struct MarkRec {
- Word markRefNum; /* MarkRec - */
- Long position; /* MarkRec - */
- } MarkRec, *MarkRecPtr, **MarkRecHndl;
-
- /* for NewLine */
-
- typedef struct NewlineRec {
- Word newLRefNum; /* NewlineRec - */
- Word enableMask; /* NewlineRec - */
- Word newlineChar; /* NewlineRec - */
- } NewlineRec, *NewlineRecPtr, **NewlineRecHndl;
-
- /* for Open */
-
- typedef struct OpenRec {
- Word openRefNum; /* OpenRec - */
- Ptr openPathname; /* OpenRec - */
- Handle ioBuffer; /* OpenRec - */
- } OpenRec, *OpenRecPtr, **OpenRecHndl;
-
- /* for Destroy, ChangePath, ClearBackupBit, GetPathname, GetBootVol */
-
- typedef struct PathNameRec {
- Ptr pathname; /* PathNameRec - */
- Ptr newPathname; /* PathNameRec - */
- } PathNameRec, *PathNameRecPtr, **PathNameRecHndl;
-
- /* for SetPrefix, GetPrefix */
-
- typedef struct PrefixRec {
- Word prefixNum; /* PrefixRec - */
- Ptr prefix; /* PrefixRec - */
- } PrefixRec, *PrefixRecPtr, **PrefixRecHndl;
-
- /* for GetVersion */
- typedef struct VersionRec {
- Word version; /* VersionRec - */
- } VersionRec, *VersionRecPtr, **VersionRecHndl;
-
- /* for Volume */
-
- typedef struct VolumeRec {
- Ptr deviceName; /* VolumeRec - */
- Ptr volName; /* VolumeRec - */
- Long totalBlocks; /* VolumeRec - */
- Long freeBlocks; /* VolumeRec - */
- Word fileSysID; /* VolumeRec - */
- } VolumeRec, *VolumeRecPtr, **VolumeRecHndl;
-
- /* for Format */
- typedef struct FormatRec {
- Ptr devName;
- Ptr volName;
- word fileSysID;
- } FormatRec, *FormatRecPtr, **FormatRecHndl;
-
- /* for Erase_Disk */
- typedef FormatRec EraseDiskRec, *EraseDiskRecPtr, **EraseDiskRecHndl;
-
- /* for Quit */
- typedef struct QuitRec {
- Ptr quitPathname;
- Word flags;
- } QuitRec, *QuitRecPtr, **QuitRecHndl;
-
- /* for DInfo */
- typedef struct DInfoRec {
- Word devNum;
- Ptr devName;
- } DInfoRec, *DInfoRecPtr, **DInfoRecHndl;
-
- typedef struct DirEntryRec {
- Word refNum;
- Word reserved; /* must be 0x0000 */
- Word base;
- Word displacement;
- Ptr nameBuffer;
- Word entryNum;
- Word fileType;
- Long endOfFile;
- LongWord blockCount;
- TimeRec createTime;
- TimeRec modTime;
- Word access;
- LongWord auxType;
- Word fileSysID;
- } DirEntryRec, *DirEntryRecPtr, **DirEntryRecHndl;
-
- #define CREATE(pBlockPtr) (PDosInt(1,pBlockPtr))
- #define DESTROY(pBlockPtr) (PDosInt(2,pBlockPtr))
- #define CHANGE_PATH(pBlockPtr) (PDosInt(4,pBlockPtr))
- #define SET_FILE_INFO(pBlockPtr) (PDosInt(5,pBlockPtr))
- #define GET_FILE_INFO(pBlockPtr) (PDosInt(6,pBlockPtr))
- #define VOLUME(pBlockPtr) (PDosInt(8,pBlockPtr))
- #define SET_PREFIX(pBlockPtr) (PDosInt(9,pBlockPtr))
- #define GET_PREFIX(pBlockPtr) (PDosInt(10,pBlockPtr))
- #define CLEAR_BACKUP_BIT(pBlockPtr) (PDosInt(11,pBlockPtr))
- #define OPEN(pBlockPtr) (PDosInt(16,pBlockPtr))
- #define NEWLINE(pBlockPtr) (PDosInt(17,pBlockPtr))
- #define READ(pBlockPtr) (PDosInt(18,pBlockPtr))
- #define WRITE(pBlockPtr) (PDosInt(19,pBlockPtr))
- #define CLOSE(pBlockPtr) (PDosInt(20,pBlockPtr))
- #define FLUSH(pBlockPtr) (PDosInt(21,pBlockPtr))
- #define SET_MARK(pBlockPtr) (PDosInt(22,pBlockPtr))
- #define GET_MARK(pBlockPtr) (PDosInt(23,pBlockPtr))
- #define SET_EOF(pBlockPtr) (PDosInt(24,pBlockPtr))
- #define GET_EOF(pBlockPtr) (PDosInt(25,pBlockPtr))
- #define SET_LEVEL(pBlockPtr) (PDosInt(26,pBlockPtr))
- #define GET_LEVEL(pBlockPtr) (PDosInt(27,pBlockPtr))
- #define GET_DIR_ENTRY(pBlockPtr) (PDosInt(28,pBlockPtr))
- #define GET_DEV_NUM(pBlockPtr) (PDosInt(32,pBlockPtr))
- #define GET_LAST_DEV(pBlockPtr) (PDosInt(33,pBlockPtr))
- #define READ_BLOCK(pBlockPtr) (PDosInt(34,pBlockPtr))
- #define WRITE_BLOCK(pBlockPtr) (PDosInt(35,pBlockPtr))
- #define FORMAT(pBlockPtr) (PDosInt(36,pBlockPtr))
- #define ERASE_DISK(pBlockPtr) (PDosInt(37,pBlockPtr))
- #define GET_NAME(pBlockPtr) (PDosInt(39,pBlockPtr))
- #define GET_PATH_NAME(pBlockPtr) (PDosInt(39,pBlockPtr))
- #define GET_BOOT_VOL(pBlockPtr) (PDosInt(40,pBlockPtr))
- #define QUIT(pBlockPtr) (PDosInt(41,pBlockPtr))
- #define GET_VERSION(pBlockPtr) (PDosInt(42,pBlockPtr))
- #define D_INFO(pBlockPtr) (PDosInt(44,pBlockPtr))
- #define ALLOC_INTERRUPT(pBlockPtr) (PDosInt(49,pBlockPtr))
- #define DEALLOC_INTERRUPT(pBlockPtr) (PDosInt(50,pBlockPtr))
-
- /* GSOS.h provides a definition which eliminates glue by using the new Stackbased
- entry point. Other wise use the PdosInt() glue call */
- #ifndef __GSOS__
- extern pascal void PDosInt();
- #endif
-
- #endif
-
-